#!/bin/sh
#
# Make the stupid susan.def file so that we don't have to do it manually
#
# Kern Sibbald, June 2007
#
NM=nm

case $1 in
   32)
      SYMBOL_START=13
      ;;
   64)
      SYMBOL_START=20
      ;;
   *)
      SYMBOL_START=13
      ;;
esac
shift

echo "LIBRARY libsusanfind.dll"
echo "EXPORTS"
echo " "

for i in $*; do \
   echo "; $i"; \
   ${NM} $i | grep "^[0-9a-f]* T " | cut -c${SYMBOL_START}- ; \
   echo " "; \
done

DATA="\
plugin_bopen \
plugin_bclose \
plugin_bread \
plugin_bwrite \
plugin_blseek \
"
for i in ${DATA}; do \
   echo "$i DATA"; \
done
